package com.java.diagnostics.visualizer.gc.realtime.parser;

import com.java.diagnostics.visualizer.data.DataPoint;
import com.java.diagnostics.visualizer.data.SourceData;
import com.java.diagnostics.visualizer.data.StructuredData;
import com.java.diagnostics.visualizer.data.StructuredDataBuilder;
import com.java.diagnostics.visualizer.data.TupleData;
import com.java.diagnostics.visualizer.data.TupleDataBuilder;
import com.java.diagnostics.visualizer.data.axes.Axis;
import com.java.diagnostics.visualizer.data.axes.AxisPair;
import com.java.diagnostics.visualizer.data.axes.XDataAxis;
import com.java.diagnostics.visualizer.data.axes.YDataAxis;
import com.java.diagnostics.visualizer.exceptions.GCAndMemoryVisualizerException;
import com.java.diagnostics.visualizer.exceptions.GCAndMemoryVisualizerParsedDataCorruptedException;
import com.java.diagnostics.visualizer.factory.DataFactory;
import com.java.diagnostics.visualizer.factory.SourceDataFactory;
import com.java.diagnostics.visualizer.gc.realtime.util.Messages;
import com.java.diagnostics.visualizer.metadata.TupleMetaData;
import com.java.diagnostics.visualizer.metadata.TupleMetaData.TableField;
import com.java.diagnostics.visualizer.metadata.TupleMetaData.TableType;
import com.java.diagnostics.visualizer.parser.vgc.constants.VGCAxes;
import com.java.diagnostics.visualizer.parser.vgc.constants.VGCGCReasons;
import com.java.diagnostics.visualizer.parser.vgc.converters.GCNumberConverter;
import com.java.diagnostics.visualizer.parser.vgc.j9.FriendlyXMLParser;
import com.java.diagnostics.visualizer.properties.OutputProperties;
import com.java.diagnostics.visualizer.sources.Source;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class InstanceRealTimeParser
  extends RTXMLParser
{
  private static final String SYSTEM_GARBAGE_COLLECT = "system garbage collect";
  private static final String REASON = "reason";
  private static final String INTERPOLATED_DATA = Messages.getString("InstanceRealTimeParser.interpolated.data.comment");
  
  private static final String QUANTUM_ELEMENT = "<quantum";
  
  private static final String QUANTUM = "quantum";
  
  private static final String QUANTUMCOUNT = "quantumcount";
  
  private static final String REALTIMEVGC_CONTENT_TYPE = "realtimevgc";
  
  private static final String HEAP = "heap";
  
  private static final String IMMORTAL = "immortal";
  
  private static final String SUMMARY = "summary";
  
  private static final String PRIORITY = "priority";
  
  private static final String NEWPRIORITY = "newpriority";
  
  private static final String MINMS = "minms";
  
  private static final String MAXMS = "maxms";
  
  private static final String MEANMS = "meanms";
  
  private static final String EVENT = "event";
  
  private static final String DETAILS = "details";
  
  public static final String FREEBYTES = "freebytes";
  
  private static final String MINFREE = "minfree";
  
  private static final String MAXFREE = "maxfree";
  
  private static final String MEANFREE = "meanfree";
  
  private static final String TYPE = "type";
  
  private static final String GC = "gc";
  
  private TupleDataBuilder freeHeapOnSyncGC;
  
  private TupleDataBuilder freeImmortalOnSyncGC;
  
  private TupleDataBuilder quantaPerHeartbeat;
  
  private TupleDataBuilder priority;
  
  private TupleDataBuilder minimumPausePerQuanta;
  
  private TupleDataBuilder maximumPausePerQuanta;
  
  private TupleDataBuilder meanPausePerQuanta;
  
  private TupleDataBuilder minimumFreeHeap;
  
  private TupleDataBuilder maximumFreeHeap;
  
  private TupleDataBuilder meanFreeHeap;
  
  private TupleDataBuilder minimumFreeImmortalHeap;
  
  private TupleDataBuilder maximumFreeImmortalHeap;
  
  private TupleDataBuilder meanFreeImmortalHeap;
  
  private TupleDataBuilder priorityIntervals;
  
  private TupleDataBuilder heartbeatIntervals;
  
  private TupleDataBuilder synchgcIntervals;
  
  private TupleDataBuilder pauseTimes;
  
  private StructuredData events;
  
  private double quantumCount;
  
  private double heartbeatInterval;
  
  private Source source;
  
  private boolean ignoreStanza = false;
  boolean isV2Data;
  
  public SourceData parse(Source source, OutputProperties properties)
    throws GCAndMemoryVisualizerException
  {
    this.source = source;
    this.properties = properties;
    initialisePreferences();
    this.ignoreStanza = false;
    this.isGoodData = false;
    
    String variantIdentifier = source.getVariantIdentifier();
    this.sourceData = 
      GCANDMEMORYVISUALIZER_SOURCE_DATA_FACTORY.createSourceData(variantIdentifier);
    
    try
    {
      FriendlyXMLParser parser = new FriendlyXMLParser();
      parser.parse(source, this);
    }
    catch (SAXParseException e)
    {
      if (e.getMessage().indexOf("[xX][mM][lL]") > -1) {
        throw new GCAndMemoryVisualizerParsedDataCorruptedException(
          CONCATENATED_XML_MESSAGE, e.getLineNumber(), 
          e.getColumnNumber(), source.getName());
      }
      throw new GCAndMemoryVisualizerParsedDataCorruptedException(
        MessageFormat.format(BADLY_FORMED_XML_MESSAGE, 
        new Object[] { e.getMessage() }), e
        .getLineNumber(), e.getColumnNumber(), 
        source.getName());
    }
    catch (SAXException se) {
      throw new GCAndMemoryVisualizerException(se);
    }
    catch (ParserConfigurationException pe) {
      throw new GCAndMemoryVisualizerException(pe);
    }
    catch (IOException ioe) {
      throw new GCAndMemoryVisualizerException(ioe);
    }
    catch (Exception e) {
      throw new GCAndMemoryVisualizerException(e);
    }
    
    if ((this.isGoodData) && (!this.isV2Data)) {
      source.addSpecificContentType("realtimevgc");
      source.addGeneralContentType("xml");
      this.xAxis.updateNormalisation(this.sourceData);
    }
    return this.sourceData;
  }
  
  int lastReason = -1;
  String lastType = null;
  
  public void startElement(String uri, String localName, String name, Attributes atts)
  {
    if (this.isV2Data) {
      return;
    }
    if ("file".equals(name))
    {
      initialiseGeneralSourceData(this.source, this.properties);
    }
    else if ("verbosegc".equals(name)) {
      handleVerboseGC(atts);
    }
    else if (name.equals("gc")) {
      this.ignoreStanza = false;
      
      if (atts.getValue("type") != null)
      {
        this.currentComment = "";
        String type = atts.getValue("type");
        double interval = convertStringToNumber(
          atts.getValue("intervalms"));
        
        calculateTimestamp(atts, type, interval);
        
        this.currentComment = COMBINED_COMMENT
          .format(new Object[] { name, type });
        
        int reason = VGCGCReasons.nameToInt(type);
        this.lastReason = reason;
        this.lastType = type;
        
        if ("heartbeat".equals(type)) {
          this.heartbeatInterval = interval;
          addDataPoint(this.heartbeatIntervals, interval, this.currentComment);
        } else if ("priogc".equals(type)) {
          addDataPoint(this.priorityIntervals, interval, this.currentComment);
        } else if ("synchgc".equals(type)) {
          addDataPoint(this.synchgcIntervals, interval, this.currentComment);
        } else if (("trigger start".equals(type)) || 
          ("trigger end".equals(type)) || 
          ("cycle start".equals(type)) || 
          ("cycle end".equals(type))) {
          this.isV2Data = true;
        }
        
      }
    }
    else if (!this.ignoreStanza)
    {
      if ("heap".equals(name)) {
        processHeap(name, atts, this.freeHeapOnSyncGC, this.minimumFreeHeap, 
          this.maximumFreeHeap, this.meanFreeHeap);
      }
      else if ("immortal".equals(name)) {
        this.isGoodData = true;
        processHeap(name, atts, this.freeImmortalOnSyncGC, 
          this.minimumFreeImmortalHeap, this.maximumFreeImmortalHeap, 
          this.meanFreeImmortalHeap);
      }
      else if ("summary".equals(name)) {
        this.quantumCount = 
          convertStringToNumber(atts.getValue("quantumcount"));
        addDataPoint(this.quantaPerHeartbeat, this.quantumCount, this.currentComment);
      } else if ("priority".equals(name)) {
        double newpriority = convertStringToNumber(
          atts.getValue("newpriority"));
        addDataPoint(this.priority, newpriority, this.currentComment);
      }
      else if ("quantum".equals(name)) {
        this.isGoodData = true;
        double minimum = convertStringToNumber(atts.getValue("minms"));
        addDataPoint(this.minimumPausePerQuanta, minimum, this.currentComment);
        double maximum = convertStringToNumber(atts.getValue("maxms"));
        addDataPoint(this.maximumPausePerQuanta, maximum, this.currentComment);
        double mean = convertStringToNumber(atts.getValue("meanms"));
        addDataPoint(this.meanPausePerQuanta, mean, this.currentComment);
        
        addInInterpolatedPauseTimes(mean);
      }
      else if ("event".equals(name))
      {
        if (this.events == null) {
          HashMap hashMap = new HashMap();
          this.events = factory
          
            .createStructuredData("RealtimeLabels.events", Messages.getString("RealtimeLabels.events"), hashMap);
        }
        String eventType = atts.getValue("details");
        this.events.getContents().put(eventType, 
          new Date((long) (1000.0D * this.xAxis.getX())));
      }
      else if ("details".equals(name)) {
        this.isGoodData = true;
        String reason = atts.getValue("reason");
        if ("system garbage collect".equals(reason)) {
          if (!this.filterSystemGCs) {
            this.lastReason = VGCGCReasons.SYS_INT;
          }
          else
          {
            this.ignoreStanza = true;
            this.lastReason = -1;
          }
        }
      }
      else if (("exclusiveaccess".equals(name)) || 
        ("gcthreadpriority".equals(name)) || 
        ("synchronousgcpriority".equals(name))) {
        this.isV2Data = true;
      }
    }
  }
  
  private void addInInterpolatedPauseTimes(double mean)
  {
    if (this.interpolateTimestamps) {
      double heartbeatIntervalInSec = this.heartbeatInterval / 1000.0D;
      double startingTimestamp = this.xAxis.getX();
      DataPoint lastDataPoint = this.pauseTimes.getLastDataPoint();
      if (lastDataPoint != null) {
        double maxHeartbeat = startingTimestamp - 
          lastDataPoint.getRawX();
        heartbeatIntervalInSec = Math.min(heartbeatIntervalInSec, 
          maxHeartbeat);
      }
      double spacer = heartbeatIntervalInSec / this.quantumCount;
      
      double originalTimeStamp = this.xAxis.getX();
      for (int i = 0; i < this.quantumCount; i++)
      {
        double timestamp = startingTimestamp - (
          heartbeatIntervalInSec - i * spacer);
        
        this.xAxis.setX(timestamp);
        this.pauseTimes.addDataPoint(mean, INTERPOLATED_DATA);
        
        this.gcNumberConverter.addPoint(this.xAxis.getSequenceUID(), 
          this.currentGCNumber);
      }
      
      this.xAxis.setX(originalTimeStamp);
    }
  }
  
  private void handleVerboseGC(Attributes atts)
  {
    this.restartCount += 1;
    
    if (this.xAxis.getX() > -1.0D) {
      addDataPoint(this.restartTuple, 1.0D, "");
    }
    
    workOutVersion(atts);
  }
  
  private void processHeap(String name, Attributes atts, TupleData freeHeap, TupleData minimumHeap, TupleData maximumHeap, TupleData meanHeap)
  {
    String freebytes = atts.getValue("freebytes");
    if (freebytes != null) {
      double free = convertStringToNumber(freebytes);
      addDataPoint(freeHeap, free, "");
    } else {
      double minimum = convertStringToNumber(atts.getValue("minfree"));
      addDataPoint(minimumHeap, minimum, "");
      double maximum = convertStringToNumber(atts.getValue("maxfree"));
      addDataPoint(maximumHeap, maximum, "");
      double mean = convertStringToNumber(atts.getValue("meanfree"));
      addDataPoint(meanHeap, mean, "");
    }
  }
  
  public void endElement(String uri, String localName, String name) {
    if (this.isV2Data) {
      return;
    }
    if ((name.equals("gc")) && (this.lastReason != -1)) {
      this.gcReasons.addDataPoint(this.lastReason, this.lastType);
      this.lastReason = -1;
      this.lastType = null;
    }
    
    if ("file".equals(name))
    {
      writeOutSourceData();
    }
  }
  
  private void writeOutSourceData() {
    if (this.isGoodData) {
      addData(this.gcReasons);
      addData(this.freeHeapOnSyncGC);
      addData(this.freeImmortalOnSyncGC);
      addData(this.freeImmortalOnSyncGC);
      addData(this.quantaPerHeartbeat);
      addData(this.minimumPausePerQuanta);
      addData(this.maximumPausePerQuanta);
      addData(this.meanPausePerQuanta);
      addData(this.minimumFreeHeap);
      addData(this.maximumFreeHeap);
      addData(this.meanFreeHeap);
      addData(this.minimumFreeImmortalHeap);
      addData(this.maximumFreeImmortalHeap);
      addData(this.meanFreeImmortalHeap);
      addData(this.priorityIntervals);
      addData(this.heartbeatIntervals);
      addData(this.synchgcIntervals);
      addData(this.priority);
      addData(this.pauseTimes);
      addData(this.events);
      if (!this.restartTuple.isEmpty()) {
        addData(this.restartTuple);
      }
      
      StructuredDataBuilder quantumPauseSummary = factory
        .createStructuredData(
        "RealtimeLabels.quantum.pause.summary", 
        
        Messages.getString("RealtimeLabels.quantum.pause.summary"));
      
      String pauseUnits = this.meanPausePerQuanta.getYAxis().getAxis()
        .getBaseUnitName();
      quantumPauseSummary.put(MessageFormat.format(
        Messages.getString("RealtimeLabels.minimum.quantum.pause.summary"), 
        new Object[] { pauseUnits }), 
        Double.valueOf(this.minimumPausePerQuanta.getMinY(pauseUnits)));
      
      quantumPauseSummary.put(MessageFormat.format(
        Messages.getString("RealtimeLabels.maximum.quantum.pause.summary"), 
        new Object[] { pauseUnits }), 
        Double.valueOf(this.maximumPausePerQuanta.getMaxY(pauseUnits)));
      
      quantumPauseSummary.put(MessageFormat.format(
        Messages.getString("RealtimeLabels.mean.quantum.pause.summary"), 
        new Object[] { pauseUnits }), new Double(
        this.meanPausePerQuanta.getMeanY(pauseUnits)));
      
      addData(quantumPauseSummary);
      
      recordVersion();
    }
  }
  
  protected void initialiseSpecificSourceData(OutputProperties properties) {
    AxisPair heapAxisPair = factory.createAxisPair(this.xAxis, this.heapAxis);
    YDataAxis numberAxis = VGCAxes.prepareNumberAxis(properties);
    YDataAxis timeAxis = VGCAxes.prepareTimeAxis(properties);
    AxisPair timePair = factory.createAxisPair(this.xAxis, timeAxis);
    
    this.freeHeapOnSyncGC = factory
    
      .createTupleData("RealtimeLabels.free.heap.at.synchgc", Messages.getString("RealtimeLabels.free.heap.at.synchgc"), heapAxisPair);
    this.freeImmortalOnSyncGC = 
      factory
      
      .createTupleData("RealtimeLabels.free.immortal.at.synchgc", Messages.getString("RealtimeLabels.free.immortal.at.synchgc"), heapAxisPair);
    this.minimumFreeHeap = 
      factory
      
      .createTupleData("RealtimeLabels.free.heap.min.per.quantum", Messages.getString("RealtimeLabels.free.heap.min.per.quantum"), heapAxisPair);
    this.maximumFreeHeap = 
      factory
      
      .createTupleData("RealtimeLabels.free.heap.max.per.quantum", Messages.getString("RealtimeLabels.free.heap.max.per.quantum"), heapAxisPair);
    this.meanFreeHeap = factory
    
      .createTupleData("RealtimeLabels.free.heap.mean.per.quantum", Messages.getString("RealtimeLabels.free.heap.mean.per.quantum"), heapAxisPair);
    this.minimumFreeImmortalHeap = 
      factory
      
      .createTupleData("RealtimeLabels.free.immortal.min.per.quantum", Messages.getString("RealtimeLabels.free.immortal.min.per.quantum"), heapAxisPair);
    this.maximumFreeImmortalHeap = 
      factory
      
      .createTupleData("RealtimeLabels.free.immortal.max.per.quantum", Messages.getString("RealtimeLabels.free.immortal.max.per.quantum"), heapAxisPair);
    this.meanFreeImmortalHeap = 
      factory
      
      .createTupleData("RealtimeLabels.free.immortal.mean.per.quantum", Messages.getString("RealtimeLabels.free.immortal.mean.per.quantum"), heapAxisPair);
    
    this.priority = factory
      .createTupleData("RealtimeLabels.gc.priority", Messages.getString("RealtimeLabels.gc.priority"), this.xAxis, numberAxis);
    this.quantaPerHeartbeat = factory
    
      .createTupleData("RealtimeLabels.quanta.per.heartbeat", Messages.getString("RealtimeLabels.quanta.per.heartbeat"), this.xAxis, numberAxis);
    this.minimumPausePerQuanta = factory
    
      .createTupleData("RealtimeLabels.minimum.pause.per.quantum", Messages.getString("RealtimeLabels.minimum.pause.per.quantum"), timePair);
    this.maximumPausePerQuanta = factory
    
      .createTupleData("RealtimeLabels.maximum.pause.per.quantum", Messages.getString("RealtimeLabels.maximum.pause.per.quantum"), timePair);
    this.meanPausePerQuanta = factory
    
      .createTupleData("RealtimeLabels.mean.pause.per.quantum", Messages.getString("RealtimeLabels.mean.pause.per.quantum"), timePair);
    
    this.priorityIntervals = factory
    
      .createTupleData("RealtimeLabels.intervals.priority.changes", Messages.getString("RealtimeLabels.intervals.priority.changes"), timePair);
    this.heartbeatIntervals = factory
    
      .createTupleData("RealtimeLabels.intervals.heartbeats", Messages.getString("RealtimeLabels.intervals.heartbeats"), timePair);
    this.synchgcIntervals = 
      factory
      
      .createTupleData("RealtimeLabels.intervals.synchronous.gc.triggers", Messages.getString("RealtimeLabels.intervals.synchronous.gc.triggers"), timePair);
    
    this.pauseTimes = 
      factory
      
      .createTupleData("VGCLabels.pause.times.with.exclusive.access", Messages.getString("VGCLabels.pause.times.with.exclusive.access"), timePair);
    
    TupleMetaData freeHeapOnSyncGCMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData freeImmortalOnSyncGCMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData quantaPerHeartbeatMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData priorityMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData minimumPausePerQuantaMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData maximumPausePerQuantaMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData meanPausePerQuantaMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData minimumFreeHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData maximumFreeHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData meanFreeHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData minimumFreeImmortalHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData maximumFreeImmortalHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData meanFreeImmortalHeapMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData priorityIntervalsMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData heartbeatIntervalsMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData synchgcIntervalsMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    TupleMetaData pauseTimesMetaData = new TupleMetaData(
      TupleMetaData.TableType.ARITHMETIC, new TupleMetaData.TableField[] { TupleMetaData.TableField.MEAN, 
      TupleMetaData.TableField.MIN, TupleMetaData.TableField.MAX });
    
    this.freeHeapOnSyncGC.setTupleMetaData(freeHeapOnSyncGCMetaData);
    this.freeImmortalOnSyncGC.setTupleMetaData(freeImmortalOnSyncGCMetaData);
    this.quantaPerHeartbeat.setTupleMetaData(quantaPerHeartbeatMetaData);
    this.priority.setTupleMetaData(priorityMetaData);
    this.minimumPausePerQuanta.setTupleMetaData(minimumPausePerQuantaMetaData);
    this.maximumPausePerQuanta.setTupleMetaData(maximumPausePerQuantaMetaData);
    this.meanPausePerQuanta.setTupleMetaData(meanPausePerQuantaMetaData);
    this.minimumFreeHeap.setTupleMetaData(minimumFreeHeapMetaData);
    this.maximumFreeHeap.setTupleMetaData(maximumFreeHeapMetaData);
    this.meanFreeHeap.setTupleMetaData(meanFreeHeapMetaData);
    this.minimumFreeImmortalHeap
      .setTupleMetaData(minimumFreeImmortalHeapMetaData);
    this.maximumFreeImmortalHeap
      .setTupleMetaData(maximumFreeImmortalHeapMetaData);
    this.meanFreeImmortalHeap.setTupleMetaData(meanFreeImmortalHeapMetaData);
    this.priorityIntervals.setTupleMetaData(priorityIntervalsMetaData);
    this.heartbeatIntervals.setTupleMetaData(heartbeatIntervalsMetaData);
    this.synchgcIntervals.setTupleMetaData(synchgcIntervalsMetaData);
    this.pauseTimes.setTupleMetaData(pauseTimesMetaData);
  }
}
